import 'package:flutter/material.dart';
import 'package:flutter_bilibili/core/extension/int_extension.dart';

class HYUserLevel extends StatelessWidget {
  int level;

  HYUserLevel({required this.level});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(left: 5.px),
      child: Text.rich(TextSpan(children: [
        WidgetSpan(
          child: Container(
            decoration: BoxDecoration(
                color: Color.fromRGBO(233, 103, 43, 1),
                borderRadius:
                    BorderRadius.horizontal(left: Radius.circular(2.px))),
            child: Text(" LV",
                style: TextStyle(
                    fontSize: 10.px,
                    color: Colors.white,
                    fontWeight: FontWeight.bold)),
          ),
        ),
        WidgetSpan(
          child: Container(
            decoration: BoxDecoration(
                color: Color.fromRGBO(233, 103, 43, 1),
                borderRadius:
                    BorderRadius.horizontal(right: Radius.circular(2.px))),
            child: Text("$level",
                style: TextStyle(
                    fontSize: 11.px,
                    color: Colors.white,
                    fontWeight: FontWeight.bold)),
          ),
        )
      ])),
    );
  }
}
